﻿using System;
using Autodesk.Revit.DB;

namespace ModelValidation.AreaRatioWindowToWall
{
	internal class FacadeMaker
	{
		public Document Doc
		{
			get
			{
				return this.m_Doc;
			}
		}

		public Facade NorthFacade
		{
			get
			{
				return this.m_NorthFacade;
			}
		}

		public Facade SouthFacade
		{
			get
			{
				return this.m_SouthFacade;
			}
		}

		public Facade WestFacade
		{
			get
			{
				return this.m_WestFacade;
			}
		}

		public Facade EastFacade
		{
			get
			{
				return this.m_EastFacade;
			}
		}

		public Transform TrueNorth
		{
			get
			{
				return this.m_TrueNorth;
			}
		}

		internal FacadeMaker(Autodesk.Revit.DB.Document doc)
		{
			this.m_Doc = doc;
		}

		public void GetTrueNorth()
		{
			this.m_TrueNorth = this.m_Doc.ActiveProjectLocation.GetTotalTransform();
		}

		public void MakeAllFacade()
		{
			this.m_TrueNorth.OfVector(new XYZ(Math.Cos(0.52359877559829882), Math.Sin(0.52359877559829882), 0.0));
			this.m_NorthFacade = new Facade(this.m_TrueNorth.OfVector(new XYZ(Math.Cos(0.52359877559829882), Math.Sin(0.52359877559829882), 0.0)), this.m_TrueNorth.OfVector(new XYZ(-Math.Cos(0.52359877559829882), Math.Sin(0.52359877559829882), 0.0)));
			this.m_SouthFacade = new Facade(this.m_TrueNorth.OfVector(new XYZ(-Math.Sin(0.52359877559829882), -Math.Cos(0.52359877559829882), 0.0)), this.m_TrueNorth.OfVector(new XYZ(Math.Sin(0.52359877559829882), -Math.Cos(0.52359877559829882), 0.0)));
			this.m_WestFacade = new Facade(this.m_TrueNorth.OfVector(new XYZ(-Math.Cos(0.52359877559829882), Math.Sin(0.52359877559829882), 0.0)), this.m_TrueNorth.OfVector(new XYZ(-Math.Sin(0.52359877559829882), -Math.Cos(0.52359877559829882), 0.0)));
			this.m_EastFacade = new Facade(this.m_TrueNorth.OfVector(new XYZ(Math.Sin(0.52359877559829882), -Math.Cos(0.52359877559829882), 0.0)), this.m_TrueNorth.OfVector(new XYZ(Math.Cos(0.52359877559829882), Math.Sin(0.52359877559829882), 0.0)));
		}

		private Document m_Doc;

		private Facade m_NorthFacade;

		private Facade m_SouthFacade;

		private Facade m_WestFacade;

		private Facade m_EastFacade;

		private Transform m_TrueNorth;
	}
}
